#pragma once

#include <random>

template<class T>
class RandomGen
{
public:
    // init with random range
    explicit RandomGen(T min, T max)
	  : gen_(std::random_device()()),
	  distribution_(std::uniform_int_distribution<T>(min , max))
    {
	}

    // return a random number
    T operator()()
	{
		return distribution_(gen_);
	}

private:
    std::mt19937 gen_;
    std::uniform_int_distribution<T> distribution_;
};

template<class T>
class RandomGenReal
{
public:
    // init with random range
    explicit RandomGenReal(T min, T max)
	  : gen_(std::random_device()()),
	  distribution_(std::uniform_real_distribution<T>(min , max))
    {
	}

    // return a random number
    T operator()()
	{
		return distribution_(gen_);
	}

private:
    std::mt19937 gen_;
    std::uniform_real_distribution<T> distribution_;
};